package com.hxkj.controller.userCenter;

import com.github.pagehelper.PageInfo;
import com.hxkj.domain.po.CertExpert;
import com.hxkj.domain.po.CertOrgs;
import com.hxkj.domain.vo.ExpertAuditRecordVO;
import com.hxkj.domain.vo.OrgsAuditRecordVO;
import com.hxkj.service.userCenter.AuditExpertService;
import com.hxkj.service.userCenter.AuditOrgsService;
import com.platform.common.domain.to.PageTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * @author zhangheng
 * @date 2018-10-11 19:44
 */
@RestController
@RequestMapping("/auditOrgs")
public class AuditOrgsController {

    @Autowired
    private AuditOrgsService auditOrgsService;

    @RequestMapping(value = "/getList")
    public Callable<PageInfo<CertOrgs>> getList(@ModelAttribute CertOrgs orgs, @ModelAttribute PageTo pageParam) throws Exception{
        return () ->auditOrgsService.getList(orgs, pageParam);
    }

    @RequestMapping(value = "/getInfo")
    public Callable<CertOrgs> getInfo(@ModelAttribute CertOrgs orgs) throws Exception{
        return () ->auditOrgsService.getInfo(orgs);
    }

    @RequestMapping(value = "/getAuditList")
    public Callable<OrgsAuditRecordVO> getAuditList(@ModelAttribute CertOrgs orgs) throws Exception{
        return () ->auditOrgsService.getAuditList(orgs);
    }

    @RequestMapping(value = "/auditOrgs")
    public void auditOrgs(@ModelAttribute CertOrgs orgs) throws Exception{
        auditOrgsService.auditOrgs(orgs);
    }

}
